<include file="Public/header"/>

<div id="app">
    <!-- sidebar -->
    <include file="Public/left"/>
    <!-- / sidebar -->
    <div class="app-content">
        <!-- start: TOP NAVBAR -->
        <include file="Public/headernav"/>
        <!-- end: TOP NAVBAR -->
        <div class="main-content" >
            <div class="wrap-content container" id="container">
                <!-- start: PAGE TITLE -->
                <section id="page-title">
                    <div class="row">
                        <div class="col-sm-8">
                            <h1 class="mainTitle">店铺滚动图审核</h1>
                            <span class="mainDescription"></span>
                        </div>
                        <nav id="cl-effect-10" class="links cl-effect-10">
                            <a data-hover="返回" href="javascript:history.go(-1)"><span>返回</span></a>
                        </nav>
                    </div>
                </section>
                <!-- end: PAGE TITLE -->
                <!-- start: YOUR CONTENT HERE -->



                <table class="table table-striped table-hover" id="sample-table-2">
                    <thead>
                    <tr>
                        <th class="center"></th>
                        <th>上传商家</th>
                        <th>商家id</th>
                        <th>上传时间</th>
                        <th >是否审核</th>
                        <th>删除</th>
                    </tr>
                    </thead>
                    <tbody>
                    <volist  name="list" id='vo' key='key'>
                        <tr>
                            <td class="center slide" >
                                <img src="{$vo.img_url}" class="img-rounded" style="max-width:100px;max-height:100px;" alt="无图片">
                            </td>
                            <td>{$vo.member_name}</td>
                            <td >{$vo.member_id}</td>
                            <td>
                                {$vo.add_time|date="Y-m-d H:i:s",###}
                            </td>
                            <td id="check{$vo.id}">
                                <if condition="$vo.is_check  eq 1">
                                    <a href="javascript:void(0)"
                                       class="btn btn-transparent btn-xs"  tooltip="Edit"  tooltip-placement="top"
                                       data-toggle="tooltip" onclick="changeShow({$vo.id},{$vo.is_check })"
                                       data-original-title="已审核"><i class="fa fa-check-circle" ></i></a>
                                    <else/>
                                    <a href="javascript:void(0)"
                                       class="btn btn-transparent btn-xs"  tooltip="Edit"  tooltip-placement="top"
                                       data-toggle="tooltip" onclick="changeShow({$vo.id},{$vo.is_check })"
                                       data-original-title="未审核"><i class="fa fa-check-circle" style="color:#ccc;"  value="1"></i></a>
                                </if>
                            </td>
                            <td >
                                <div class="visible-md visible-lg hidden-sm hidden-xs">
<!--
                                <a href="{:U("Admin/membervip/slide_image_edit",array('id'=>$vo['id']))}" class="btn btn-transparent btn-xs" tooltip-placement="top" data-toggle="tooltip" data-original-title="编辑"><i class="fa fa-pencil"></i></a>
-->                             <a href="{:U("Admin/membervip/slide_image_del",array('id'=>$vo['id']))}" class="btn btn-transparent btn-xs tooltips" tooltip-placement="top" data-toggle="tooltip" data-original-title="删除">
                                    <i class="fa fa-times fa fa-white" onclick="return confirm('确定删除该图片？')"></i>
                                </a>

                                </div>
                            </td>
                        </tr>

                    </volist>




                    </tbody>
                </table>

                <div class="col-md-12 pages" align="center">{$list['page']|default='暂无数据'}</div>


                <!-- end: YOUR CONTENT HERE -->
            </div>
        </div>
    </div>
    <!--  FOOTER and SETTINGS -->

    <include file="Public/footer"/>
    <!-- end: FOOTER -->
    <!-- start: OFF-SIDEBAR -->

    <!-- end: OFF-SIDEBAR -->

</div>
<!-- start: MAIN JAVASCRIPTS -->

<include file="Public/javascript"/>

<!-- end: CLIP-TWO JAVASCRIPTS -->
<script type="text/javascript">
    function changeShow(id,value){
        if(value==0){
            value =1;
            var sale='通过审核';
        }else{
            value=0;
            var sale='取消审核';
        }
        if(confirm('确定'+sale+'?')){
            $.ajax({
                url:'{:U("Admin/membervip/is_check_slide")}',
                type:'get',
                data:'id='+id+'&value='+value,
                dataType:'json',
                success : function(data){
                    console.log(data);
                    if(data.status==1){
                        $('#check'+id).empty();
                        if(value){
                            var content = '<a href="javascript:void(0)" class="btn btn-transparent btn-xs" tooltip = "Edit" tooltip - placement = "top" data - toggle = "tooltip" onclick = "changeShow('+id+','+value+')" data - original - title = "'+sale+'" > <i class="fa fa-check-circle" ></i></a>'
                        }else{
                            var content = '<a href="javascript:void(0)" class="btn btn-transparent btn-xs" tooltip = "Edit" tooltip - placement = "top" data - toggle = "tooltip" onclick = "changeShow('+id+','+value+')" data - original - title = "'+sale+'" > <i class="fa fa-check-circle" style="color:#ccc;"  value="1"></i></a>'
                        }
                        $('#check'+id).append(content);
                        layer.msg(sale+'成功',{icon:6});
                    }else{
                        layer.msg(data.error,{icon:5});
                    }
                }
            })
        }
    }

    $('.slide').click(function (e) {
        $('.slide').removeAttr('style');
        $('.slide').find('img').animate({'max-width':'100px','max-height':'100px'});
       $(this).animate({'width':'300px','height':'300px'});
       $(this).find('img').animate({'max-width':'300px','max-height':'300px'});
        e.stopPropagation();
    });
    $(document).click(function (e) {
        $('.slide').removeAttr('style');
        $('.slide').find('img').animate({'max-width':'100px','max-height':'100px'});
    });



</script>
</body>
</html>
